package cn.cboard.dao;

import cn.cboard.dao.sql.ForumDaoSql;
import cn.cboard.dao.sql.SequenceDaoSql;
import cn.cboard.dao.sql.SessionDaoSql;
import cn.cboard.dao.sql.ThreadDaoSql;
import cn.cboard.dao.sql.TopicDaoSql;
import cn.cboard.dao.sql.TopicQueryDaoSql;
import cn.cboard.dao.sql.UserDaoSql;
import cn.cboard.dao.sql.UserGroupDaoSql;
import cn.cboard.database.JdbcBuilder;
import cn.cboard.database.Query;

public final class DaoFacade {
	private DaoFacade(){}
	
	
	public static ForumDao getForumDao(){
		Query query = JdbcBuilder.beginPoolQuery();
		return new ForumDaoSql(query); 
	}
	
	public static ThreadDao getThreadDao(){
		Query query = JdbcBuilder.beginPoolQuery();
		return new ThreadDaoSql(query);
	}
	
	public static TopicDao getTopicDao(){
		Query query = JdbcBuilder.beginPoolQuery();
		return new TopicDaoSql(query);
	}
	
	public static SessionDao getSessionDao(){
		Query query = JdbcBuilder.beginPoolQuery();
		return new SessionDaoSql(query);
	}


	public static TopicQueryDao getTopicQueryDao() {
		Query query = JdbcBuilder.beginPoolQuery();
		return new TopicQueryDaoSql(query);
	}
	
	public static UserDao getUserDao(){
		Query query = JdbcBuilder.beginPoolQuery();
		return new UserDaoSql(query);
	}
	public static UserGroupDao getUserGroupDao(){
		Query query = JdbcBuilder.beginPoolQuery();
		return new UserGroupDaoSql(query);
	}
	
	public static SequenceDao getSequenceDao(){
		Query query = JdbcBuilder.beginPoolQuery();
		return new SequenceDaoSql(query);
	}
}
